//
//  SweetAlertViewController.swift
//  eCLINICAL
//
//  Created by tom on 15/11/10.
//  Copyright © 2015年 tusm. All rights reserved.
//

import UIKit

class SweetAlertViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
SweetAlert().showAlert("Here's a message!")
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    var alert = SweetAlert()

    
    override func viewDidAppear(animated: Bool) {
        
        
    }

    
    @IBAction func aBasicMessageAlert(sender: AnyObject) {
        SweetAlert().showAlert("Here's a message!")
    }
    
    
    @IBAction func subtitleAlert(sender: AnyObject) {
        
        SweetAlert().showAlert("Here's a message!", subTitle: "It's pretty, isn't it?", style: AlertStyle.None)
    }
    
    @IBAction func sucessAlert(sender: AnyObject) {
        SweetAlert().showAlert("Good job!", subTitle: "You clicked the button!", style: AlertStyle.Success)
    }
    
    @IBAction func warningAlert(sender: AnyObject) {
        SweetAlert().showAlert("Are you sure?", subTitle: "You file will permanently delete!", style: AlertStyle.Warning, buttonTitle:"Cancel", buttonColor:UIColor.colorFromRGB(0xD0D0D0) , otherButtonTitle:  "Yes, delete it!", otherButtonColor: UIColor.colorFromRGB(0xDD6B55)) { (isOtherButton) -> Void in
            if isOtherButton == true {
                
                print("Cancel Button  Pressed", terminator: "")
            }
            else {
                SweetAlert().showAlert("Deleted!", subTitle: "Your imaginary file has been deleted!", style: AlertStyle.Success)
            }
        }
    }
    
    @IBAction func cancelAndConfirm(sender: AnyObject) {
        SweetAlert().showAlert("Are you sure?", subTitle: "You file will permanently delete!", style: AlertStyle.Warning, buttonTitle:"No, cancel plx!", buttonColor:UIColor.colorFromRGB(0xD0D0D0) , otherButtonTitle:  "Yes, delete it!", otherButtonColor: UIColor.colorFromRGB(0xDD6B55)) { (isOtherButton) -> Void in
            if isOtherButton == true {
                
                SweetAlert().showAlert("Cancelled!", subTitle: "Your imaginary file is safe", style: AlertStyle.Error)
            }
            else {
                SweetAlert().showAlert("Deleted!", subTitle: "Your imaginary file has been deleted!", style: AlertStyle.Success)
            }
        }
        
    }
    
    @IBAction func customIconAlert(sender: AnyObject) {
        SweetAlert().showAlert("Sweet!", subTitle: "Here's a custom image.", style: AlertStyle.CustomImag(imageFile: "thumb.jpg"))
    }

    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
